﻿using Model.BusinessModel.InPut;
using Model.BusinessModel.OutPut;
using Model.BusinessModel.OutPut.sys;
using Model.DomainModel.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Utility;

namespace DomainService.IService.Sys
{
    /// <summary>
    /// 角色服务接口
    /// </summary>
    public interface ISysRoleService
    {
        /// <summary>
        /// 获取全部角色
        /// </summary>
        /// <returns></returns>
        List<SysRoleOutPut> GetAllRoleTreeList(LoginOutPut loginModel);

        /// <summary>
        /// 新增角色
        /// </summary>
        /// <param name="sysRole">角色数据</param>
        ReceiveStatus Insert(SysRole sysRole);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="sysRole">角色数据</param>
        ReceiveStatus Update(SysRole sysRole);

        /// <summary>
        /// 设置角色是否启用
        /// </summary>
        /// <param name="updateIsOpenInPut">修改模型</param>
        /// <returns></returns>
        ReceiveStatus SetRoleIsOpen(UpdateIsOpenInPut updateIsOpenInPut);

        /// <summary>
        /// 获取树形结构角色数据
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="systemKey">系统key</param>
        /// <returns></returns>
        ReceiveStatus<TreeOutPut> GetRoleTree(string corporationKey, string? systemKey);

        /// <summary>
        /// 保存角色权限--菜单权限
        /// </summary>
        /// <param name="roleMenuExend">角色和菜单模型</param>
        /// <param name="userId">操作人员id</param>
        ReceiveStatus SaveRoleAuthority(RoleMenuInput roleMenuExend, string userId);

        /// <summary>
        /// 保存角色权限--按钮权限
        /// </summary>
        /// <param name="RoleButtonInput">角色和按钮模型</param>
        /// <param name="userId">操作人员id</param>
        ReceiveStatus SaveRoleButtonAuthority(RoleButtonInput roleButtonExend, string userId);

        /// <summary>
        /// 绑定角色用户
        /// </summary>
        /// <param name="roleUserInput">角色和用户模型</param>
        /// <param name="userId">操作人员id</param>
        ReceiveStatus BindRoleUser(RoleUserInput roleUserInput, string userId);

        /// <summary>
        /// 根据角色id获取权限菜单
        /// </summary>
        /// <param name="roleId">角色id</param>
        /// <param name="corporationKey">公司key</param>
        /// <param name="isContainSubordinate">是否包含下级角色</param>
        /// <returns>返回角色所属菜单key</returns>
        ReceiveStatus<MenuOrRoleOutPut> GetMenuKeyByRoleId(int roleId, bool isContainSubordinate, string corporationKey);

        /// <summary>
        /// 根据角色id获取权限按钮
        /// </summary>
        /// <param name="roleId">角色id</param>
        /// <param name="corporationKey">公司key</param>
        /// <param name="isContainSubordinate">是否包含下级角色</param>
        /// <returns>返回角色所属按钮key</returns>
        ReceiveStatus<ButtonOrRoleOutPut> GetButtonKeyByRoleId(int roleId, bool isContainSubordinate, string corporationKey);
    }
}
